#include "MapSelector.h" 

MapSelector::MapSelector()
{

}

MapSelector::~MapSelector()
{

}

void MapSelector::RegisterObserver(MapSelectorObserver *observer)
{
	observers.push_back(observer);
}

/*
 void MapSelector::UnregisterObserver(MapSelectorObserver *observer)
 {
 std::list<MapSelectorObserver*>::iterator it;

 for(it = observers.begin(); it != observers.end(); ++it)
 {
 if ( (*it) == observer )
 {
 observers.erase(it);
 break;
 }
 }
 }
 */

void MapSelector::NotifySelectedMap()
{
	std::list<MapSelectorObserver*>::iterator it;

	for (it = observers.begin(); it != observers.end(); ++it)
	{
		(*it)->SelectedMap();
	}
}

void MapSelector::NotifyCancelled()
{
	std::list<MapSelectorObserver*>::iterator it;

	for (it = observers.begin(); it != observers.end(); ++it)
	{
		(*it)->CancelledMap();
	}
}
